/*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Alternatively, this software may be distributed under the terms of BSD
* license.
*
*
*
* Authors:                  zhoujian
* Email:            343600434@qq.com
* Date:         Apr-10-2025 15:04:59
*
*/


#ifndef __can_H__
#define __can_H__




#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>




void can_params_init(void);
void can_receive(void);
void can_deinit(void);


void can_send_data();


extern uint32_t check_can_time;



#define CAN_TIMEOUT_TIME 12
#define CAN_TIMEOUT_L 2
#define CAN_TIMEOUT_TIME_H (CAN_TIMEOUT_TIME+CAN_TIMEOUT_L)

//#define TEST_CAN_PROTOCOL


#ifdef TEST_CAN_PROTOCOL

void mcu_out0();
void mcu_out1_test(uint8_t n);

void mcu_out1();
void yb_clean();
void bat_up_status1();
void bat_down_status1();
void bat_up_status2();
void bat_down_status2();
void bat_up_fault();
void bat_down_fault();
void mcu_fault();



#endif

extern uint8_t boot_display;

void can_task_hander(void* pvParameters);

#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
class can
{

public:
    can();
    ~can();

};
#endif



#endif
